import grails.util.GrailsUtil

class BootStrap {

  def init = { servletContext ->
    switch(GrailsUtil.environment) {
      case "development": createDevTestLogins(); break
    }
  }

  def destroy = {
  }

  def createDevTestLogins() {
    if(Login.count() == 0) {
      def l = ["user":"userpass", "admin":"adminpass"] // Change these passwords. Do not use them in production.
      for(kv in l) {
        def login = new Login(password:kv.value, role:kv.key)
        login.save()
      }
    }
  }
} 